# -*- coding:utf-8 -*-

from django.contrib import admin

# Register your models here.
from apitest.models import Apitest, Apis, ApisSuite
from apptest.models import Appcase
from webtest.models import Webcase
from product.models import Product


class ApitestAdmin(admin.TabularInline):
    list_display = ['apitestname', 'apitester', 'apitestresult', 'create_time', 'id', 'product']
    model = Apitest
    extra = 1


class ProductAdmin(admin.ModelAdmin):
    list_display = ['productname', 'productdesc', 'create_time', 'id']
    inlines = [ApitestAdmin]


class ApisAdmin(admin.TabularInline):
    list_display = ['apiname', 'apiurl', 'apiparamvalue', 'apimethod', 'apiresult', 'apistatus', 'create_time', 'id',
                    'product']
    model = Apis
    extra = 1


class ApisSuiteAdmin(admin.TabularInline):
    list_display = ['case_name', 'tester', 'create_time', 'update_time', 'id', 'product']
    model = ApisSuite
    extra = 1


class ProductAdmin(admin.ModelAdmin):
    list_display = ['productname', 'productdesc', 'create_time', 'id']
    inlines = [ApisSuiteAdmin]


class ProductAdmin(admin.ModelAdmin):
    list_display = ['productname', 'productdesc', 'create_time', 'id']
    inlines = [ApisAdmin]


class AppcaseAdmin(admin.TabularInline):
    list_display = ['appcasename', 'apptestresult', 'create_time', 'id', 'product']
    model = Appcase
    extra = 1


class ProductAdmin(admin.ModelAdmin):
    list_display = ['productname', 'productdesc', 'create_time', 'id']
    inlines = [AppcaseAdmin]


class WebcaseAdmin(admin.TabularInline):
    list_display = ['webcasename', 'webtestresult', 'create_time', 'id', 'product']
    model = Webcase
    extra = 1


class ProductAdmin(admin.ModelAdmin):
    list_display = ['productname', 'productdesc', 'producter', 'create_time', 'id']
    inlines = [WebcaseAdmin]


class ProductAdmin(admin.ModelAdmin):
    list_display = ['productname', 'productdesc', 'producter', 'create_time', 'id']  # ��̨��ʾ��Ʒģ��


admin.site.register(Product, ProductAdmin)
